home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / WIN / VB_DB / PROFIT.ZIP / INGGRPBT.BAS < prev    next >
Encoding:
BASIC Source File  |  1992-12-16  |  3.9 KB  |  122 lines

  1.    '****************************************************************
  2.    '*    Ingredient group file type                                *
  3.    '****************************************************************
  4.     Type IngGroupType
  5.         IngGroup         As String * 4
  6.         IngGroupDesc     As String * 30
  7.     End Type
  8.    
  9.     Global IngGroupRec As IngGroupType
  10.     Global IngGroupSaveRec As IngGroupType
  11.     Global IngGroupSt%
  12.     Global IngGroupKeyB$
  13.     Global IngGroupPosBlk As PosBlk
  14.  
  15. Sub CloseIngGroupFile ()
  16.   '********** Close Ingredient group file **********************
  17.     IngGroupKeyBufLen% = 255
  18.     IngGroupBufLen% = Len(IngGroupRec)
  19.     KeyNum% = 0
  20.     IngGroupSt% = 0
  21.     IngGroupSt% = btrcall(BCLOSE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  22. End Sub
  23.  
  24. Sub DeleteIngGroup ()
  25.       IngGroupKeyBufLen% = 255
  26.       IngGroupBufLen% = Len(IngGroupRec)
  27.       KeyNum% = 0
  28.       IngGroupSt% = 0
  29.       IngGroupSt% = btrcall(BDELETE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  30. End Sub
  31.  
  32. Sub FirstIngGroup ()
  33.   If Len(IngGroupKeyB$) <> 4 Then
  34.     IngGroupKeyB$ = String$(4, " ")
  35.   End If
  36.   IngGroupKeyBufLen% = 255
  37.   IngGroupBufLen% = Len(IngGroupRec)
  38.   KeyNum% = 0
  39.   IngGroupSt% = 0
  40.   IngGroupSt% = btrcall(BFIRST, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  41. End Sub
  42.  
  43. Sub MsgIngGroupNotFound ()
  44.   Msg$ = "Ingredient group not found.  Status = " + Str$(IngGroupSt%)
  45.   T1% = MsgBox(Msg$, 0, "Warning!")
  46. End Sub
  47.  
  48. Sub MsgIngGroupNotOpen ()
  49.         Msg$ = "Ingredient group file not opened."
  50.         T1% = MsgBox(Msg$, 0, "Warning!")
  51. End Sub
  52.  
  53. Sub MsgUnknownIngGroupError ()
  54.   Msg$ = "Ingredient group file error.  Status = " + Str$(IngGroupSt%)
  55.   T1% = MsgBox(Msg$, 0, "Warning!")
  56. End Sub
  57.  
  58. Sub NextIngGroup ()
  59.   If Len(IngGroupKeyB$) <> 4 Then
  60.     IngGroupKeyB$ = String$(4, " ")
  61.   End If
  62.   IngGroupKeyBufLen% = 255
  63.   IngGroupBufLen% = Len(IngGroupRec)
  64.   KeyNum% = 0
  65.   IngGroupSt% = 0
  66.   IngGroupSt% = btrcall(BNEXT, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  67. End Sub
  68.  
  69. '
  70. '
  71. Sub OpenIngGroupFile ()
  72.   
  73.   '******** Open Ingredient group File ********************
  74.     IngGroupKeyB$ = "ingrfile.btr"
  75.     IngGroupKeyBufLen% = 255
  76.     IngGroupBufLen% = Len(IngGroupRec)
  77.     KeyNum% = 0
  78.     IngGroupSt% = 0
  79.     IngGroupSt% = btrcall(BOPEN, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  80.     If IngGroupSt% <> 0 Then
  81.       Msg$ = "Ingredient group file open failed. Status = " + Str$(IngGroupSt%)
  82.       T1% = MsgBox(Msg$, 0, "Warning!")
  83.     End If
  84. End Sub
  85.  
  86. Sub PreviousIngGroup ()
  87.   If Len(IngGroupKeyB$) <> 4 Then
  88.     IngGroupKeyB$ = String$(4, " ")
  89.   End If
  90.   IngGroupKeyBufLen% = 255
  91.   IngGroupBufLen% = Len(IngGroupRec)
  92.   KeyNum% = 0
  93.   IngGroupSt% = 0
  94.   IngGroupSt% = btrcall(BPREVIOUS, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  95. End Sub
  96.  
  97. Sub ReadIngGroup ()
  98.     IngGroupKeyB$ = IngGroupRec.IngGroup
  99.     IngGroupKeyBufLen% = 255
  100.     IngGroupBufLen% = Len(IngGroupRec)
  101.     KeyNum% = 0
  102.     IngGroupSt% = 0
  103.     IngGroupSt% = btrcall(BEQUAL, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  104. End Sub
  105.  
  106. Sub UpdateIngGroup ()
  107.     IngGroupKeyBufLen% = 255
  108.     IngGroupBufLen% = Len(IngGroupRec)
  109.     KeyNum% = 0
  110.     IngGroupSt% = 0
  111.     IngGroupSt% = btrcall(BUPDATE, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  112. End Sub
  113.  
  114. Sub WriteIngGroup ()
  115.       IngGroupKeyBufLen% = 255
  116.       IngGroupBufLen% = Len(IngGroupRec)
  117.       KeyNum% = 0
  118.       IngGroupSt% = 0
  119.       IngGroupSt% = btrcall(BINSERT, IngGroupPosBlk, IngGroupRec, IngGroupBufLen%, IngGroupKeyB$, IngGroupKeyBufLen%, KeyNum%)
  120. End Sub
  121.  
  122.